package com.design.command.remotecontrol2;

class RemoteControl {
    private Command[] commands;

    public RemoteControl() {
        commands = new Command[2];
        for (int i = 0; i < 2; i++) {
            commands[i] = new NoCommand();
        }
    }

    public void setCommand(int slot, Command command) {
        commands[slot] = command;
    }

    public void pressButton(int slot) {
        commands[slot].execute();
    }
}
